<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/9/9
  Time: 10:12
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>编辑</title>
    <script type="text/javascript" src="/htdc/scripts/jquery/jquery-1.7.1.js"></script>
    <link href="/htdc/style/authority/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="/htdc/style/authority/common_style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/htdc/scripts/authority/commonAll.js"></script>
    <script type="text/javascript" src="/htdc/scripts/jquery/jquery-1.4.4.min.js"></script>
    <script src="/htdc/scripts/My97DatePicker/WdatePicker.js" type="text/javascript" defer="defer"></script>
    <script type="text/javascript" src="/htdc/scripts/artDialog/artDialog.js?skin=default"></script>
    <script type="text/javascript">


        $(document).ready(function() {
            /*
             * 提交
             */
            $("#submitbutton").click(function() {

                var data=$('#submitForm').serialize();
                if(validateForm()){
                    // checkFyFhSubmit();
                    $.ajax({
                        type:"POST",
                        url:"/htdc/project/updateProject",
                        data: data,
                        success:function (result) {
                            if(result =='success'){
                                /**  关闭弹出iframe  **/
                                alert(result);
                                window.parent.$.fancybox.close();
                            }
                        }

                    })


                    // $("#submitbutton").submit(); //提交

                    // parent.$.fancybox.close(); //关闭
                    //
                    // parent.window.location.reload(); //刷新父窗口

                }
            });
        });
        function validateForm(){

            if($("#roomArea").val()==""){
                art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写项目名称', ok:true,});
                return false;
            }
            if($("#roomRealArea").val()==""){
                art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'请选择公司', ok:true,});
                return false;
            }
            if($("#rname").val()==""){
                art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写项目地址', ok:true,});
                return false;
            }
            return true;
        }

    </script>
</head>
<body>
<div id="nav_links">
    当前位置:租凭公司&nbsp;>&nbsp;<span style="color: #1A5CC6;">编辑</span>
    <div id="page_close">
        <a href="javascript:parent.$.fancybox.close();">
            <img src="/htdc/images/common/page_close.png" width="20" height="20" style="vertical-align: text-top;"/>
        </a>
    </div>
</div>
<br>


    <table>
        <form id="submitForm" name="submitForm" action="/htdc/project/updateProject" method="post" >
            <input type="hidden" name="pid" value="${projectTb.pid}">
        <tr>
            <td>项目名称</td>
            <td>
                <input type="text" name="pname" id="pname" value="${projectTb.pname}" >
            </td>
        </tr>
        <tr>
            <td>所属公司</td>
            <td>
                <select name="cid" class="ui_select01">
                    <option value="">--请选择--</option>
                    <c:forEach items="${companies}" var="company">
                        <option value="${company.cid}">${company.cname}</option>
                    </c:forEach>
                </select>
            </td>
        </tr>
        <tr>
            <td>项目地址</td>
            <td>
                   <input type="text" name="address" value="${projectTb.address}">
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td class="ui_text_lt">
                &nbsp;<input id="submitbutton" type="button" value="提交" class="ui_input_btn01"/>
                &nbsp;<input id="cancelbutton" type="button" value="取消" class="ui_input_btn01"/>
            </td>
        </tr>
        </form>
    </table>



</body>
</html>
